package com.ruoyi.platform.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.platform.mapper.TMemberLevelMapper;
import com.ruoyi.platform.domain.TMemberLevel;
import com.ruoyi.platform.service.ITMemberLevelService;

/**
 * 会员等级配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-19
 */
@Service
public class TMemberLevelServiceImpl implements ITMemberLevelService 
{
    @Autowired
    private TMemberLevelMapper tMemberLevelMapper;

    /**
     * 查询会员等级配置
     * 
     * @param levelId 会员等级配置主键
     * @return 会员等级配置
     */
    @Override
    public TMemberLevel selectTMemberLevelByLevelId(Long levelId)
    {
        return tMemberLevelMapper.selectTMemberLevelByLevelId(levelId);
    }

    /**
     * 查询会员等级配置列表
     * 
     * @param tMemberLevel 会员等级配置
     * @return 会员等级配置
     */
    @Override
    public List<TMemberLevel> selectTMemberLevelList(TMemberLevel tMemberLevel)
    {
        return tMemberLevelMapper.selectTMemberLevelList(tMemberLevel);
    }

    /**
     * 新增会员等级配置
     * 
     * @param tMemberLevel 会员等级配置
     * @return 结果
     */
    @Override
    public int insertTMemberLevel(TMemberLevel tMemberLevel)
    {
        tMemberLevel.setCreateTime(DateUtils.getNowDate());
        return tMemberLevelMapper.insertTMemberLevel(tMemberLevel);
    }

    /**
     * 修改会员等级配置
     * 
     * @param tMemberLevel 会员等级配置
     * @return 结果
     */
    @Override
    public int updateTMemberLevel(TMemberLevel tMemberLevel)
    {
        return tMemberLevelMapper.updateTMemberLevel(tMemberLevel);
    }

    /**
     * 批量删除会员等级配置
     * 
     * @param levelIds 需要删除的会员等级配置主键
     * @return 结果
     */
    @Override
    public int deleteTMemberLevelByLevelIds(Long[] levelIds)
    {
        return tMemberLevelMapper.deleteTMemberLevelByLevelIds(levelIds);
    }

    /**
     * 删除会员等级配置信息
     * 
     * @param levelId 会员等级配置主键
     * @return 结果
     */
    @Override
    public int deleteTMemberLevelByLevelId(Long levelId)
    {
        return tMemberLevelMapper.deleteTMemberLevelByLevelId(levelId);
    }
}
